/**
 * Created by IntelliJ IDEA
 *
 * @author zhengjie
 * @Date:2022/1/8 11:33
 * @Version 1.0
 */
package com.zj.ssm.controller;

import com.zj.ssm.aop.Log;
import com.zj.ssm.pojo.domain.vo.BranchVO;
import com.zj.ssm.result.AjaxResult;
import com.zj.ssm.service.BranchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("branch")
public class BranchController {

    @Autowired
    private BranchService branchService;

    @RequestMapping("list")
    public AjaxResult list(){
        return branchService.list();
    }

    @RequestMapping("liststate")
    public AjaxResult liststate(){
        return branchService.liststate();
    }

    @RequestMapping("query")
    public AjaxResult querybra(){
        return branchService.querybra();
    }

    @RequestMapping("get/{id}")
    public AjaxResult getbra(@PathVariable("id") Integer id){
        return branchService.getbra(id);
    }

    @RequestMapping("update")
    @Log("修改部门")
    public AjaxResult updatebra(BranchVO branchVO){
        return branchService.updatebra(branchVO);
    }

    @RequestMapping("add")
    @Log("添加部门")
    public AjaxResult addbra(BranchVO branchVO){
        return branchService.addbra(branchVO);
    }

    @RequestMapping("updateBranch/{id}")
    public AjaxResult updateBranch(@PathVariable("id")Integer id){
        return branchService.updateBranch(id);
    }

    @RequestMapping("branchUpdate/{id}")
    public AjaxResult branchUpdate(@PathVariable("id")Integer id){
        return branchService.branchUpdate(id);
    }


}
